/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.chipchip.objects;

/**
 *
 * @author Tri
 */
public class ExchangeKeyAttribute {
    private long secretKey = 0;
    private Tea tea;
    
    public ExchangeKeyAttribute() {
        this.secretKey = System.currentTimeMillis();
        this.tea = new Tea(this.secretKey);
    }
    
    public ExchangeKeyAttribute(long key) {
        this.secretKey = key;
        this.tea = new Tea(this.secretKey);
    }
    
    /**
     * Get a secret key from client key and server key.
     *
     * @return A secret key.
     */
    public long getSecretKey() {
        return this.secretKey;
    }
    
    /**
     * Get tea cryptography.
     *
     * @return Tea instance.
     */
    public Tea getTea() {
        return this.tea;
    }
    
    public void setSecretKey(long key) {
        this.secretKey = key;
        this.tea = new Tea(this.secretKey);
    }
}
